import PropTypes from 'prop-types'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

const ButtonBtn = ({ text, colorClass, icon, onBtnClick }) => (
    <button 
        type="button"
        className={`btn btn-block no-border ${colorClass} br-0`}
        onClick={ onBtnClick }
    >
        <FontAwesomeIcon className="mr-2" icon={icon}></FontAwesomeIcon>
        { text }
    </button>
) 
ButtonBtn.propTypes = {
    text: PropTypes.string,
    colorClass: PropTypes.string,
    icon: PropTypes.object.isRequired,
    onBtnClick: PropTypes.func
}
ButtonBtn.defaultProps = {
    text: '新建'
}
export default ButtonBtn